//--------------Logger Utility Class -----------------------------------------

#ifndef __LOGGER__
#define __LOGGER__

#include <string>
#include "easylogging++.h"
#include <fstream>
#include <iostream>

INITIALIZE_EASYLOGGINGPP
#define RUN_MODE
//#define DEBUG_MODE
namespace Engine
{
	enum LOG_TYPE
	{
		normal,
		notification,
		warning,
		error,
		critical
	};
	using std::string;
	using std::ofstream;


	//https://github.com/easylogging/easyloggingpp#why-yet-another-library

	class Logger
	{
	public:
		
		Logger()
		{
			
			//needs to be a singleton
			/*m_configuration.setToDefault();
			m_configuration.set(el::Level::Info, el::ConfigurationType::Format, "%datetime %level %msg");

			LogInfo("Logger Initialized");

			el::Loggers::reconfigureLogger("default", m_configuration);

			m_configuration.setGlobally(el::ConfigurationType::Format, "%date %msg"); 
			el::Loggers::reconfigureLogger("default", m_configuration);*/
		
			fp = ofstream("logFile.txt", ios::out | ios::binary);
		}

		Logger(bool p_writeToFile)
		{
			
		}

		Logger(string p_pathToConfigFile)
		{
			/*m_configuration = el::Configurations(p_pathToConfigFile);
			el::Loggers::reconfigureLogger("default", m_configuration);
			el::Loggers::reconfigureAllLoggers(m_configuration);*/
		}

		static void LogInfo(string p_stringToLog)
		{
			//#ifdef DEBUG_MODE
				LOG(INFO) << p_stringToLog;
			//#endif
		}

		static void LogError(string p_stringToLog)
		{
			LOG(ERROR) << p_stringToLog;
		}

		static void LogTrace(string p_stringToLog)
		{
			LOG(TRACE) << p_stringToLog;
		}

		void WriteToFile(string p_stringToWrite)
		{
			fp << p_stringToWrite << "\n";
		}

	private:
		static el::Configurations m_configuration;
		ofstream fp;
		
	};
}
#endif __LOGGER__

//--------------End Logger Utitlity Class ------------------------------------